import java.util.LinkedList;
import java.util.Queue;

public class Text {
    public static void main(String[] args) {
        //先进先出
        Queue<Integer> queue = new LinkedList<>();
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        queue.offer(5);//增加//尾差法
        System.out.println(queue.poll());//出队//头删法
        System.out.println(queue.peek());
        System.out.println(queue.isEmpty());
    }
}